#!/usr/bin/env python
#-*- coding:UTF-8 -*-
#####################################################
# Author: Jiaion - jiaion21@gmail.com
# Last modified:  2011-02-28 17:29
# Filename:  settings.py
#####################################################
# Django settings for Myweb project.

DEBUG = True
#DEBUG = False
TEMPLATE_DEBUG = DEBUG
LOGIN_URL = '/login/'
LOGIN_REDIRECT_URL = '/'
BASEROOT = '/home/Myweb'
APPNAME = 'Myweb'

import os,sys
sys.path.insert(0, os.path.join(BASEROOT, 'lib'))
sys.path.insert(0, os.path.join(BASEROOT, 'Queue'))

ADMINS = (
     #('Jiaion', 'jiaion21@gmail.com'),
)

MANAGERS = ADMINS

REDIS = {
    'HOST': '127.0.0.1',
    'PORT': 6379,
    'DB': 0,
    }

UPPATH = '/opt/Django/Myweb/upload/'

LOFDIR = '/opt/Django/Myweb/logs/'

DATABASES = {
    'default': {
        'ENGINE': 'sqlite3',                     # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': '/home/db1.db',                      # Or path to database file if using sqlite3.
        'USER': '',                      # Not used with sqlite3.
        'PASSWORD': '',              # Not used with sqlite3.
        'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '',
    }
}

TIME_ZONE = 'Asia/Shanghai'

LANGUAGE_CODE = 'zh_cn'

SITE_ID = 1

USE_I18N = True

USE_L10N = True

MEDIA_ROOT = BASEROOT + '/static/'

MEDIA_URL = '/static/'

ADMIN_MEDIA_PREFIX = '/media/'

SECRET_KEY = 'hlau3v9(g)w#m9rp@v%%ictb)m8)*e)39(j)!@eln$l%x6pb9m'

TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
    #'django.template.loaders.eggs.Loader',
)

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.core.context_processors.media',
    #'django.core.context_processors.request',
    'Context.CONPROCE.AdminSwitch',
)

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    #'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
)

ROOT_URLCONF = APPNAME + '.urls'

TEMPLATE_DIRS = (
    BASEROOT + '/templates',
)

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    #'django.contrib.admin',
    #'django.contrib.messages',
    APPNAME + '.Jiaion',
)
